import request from '@/utils/request'

// 获取授权信息列表通过条件和Id
export function listAccountAuthorize(query) {
  return request({
    url: 'system/account/authorize/list',
    method: 'get',
    params: query
  })
}

// 通过酒店ID获取酒店授权信息
export function accountAuthorizeById(query) {
  return request({
    url: 'system/account/authorize',
    method: 'get',
    params: query
  })
}

// 通过酒店ID获取酒店授权信息
export function getApiTokenAndExpressMessage(data) {
  return request({
    url: 'system/account/authorize/getTokenAndExpirationTime',
    method: 'post',
    data: data
  })
}

//新增加授权信息
export function addAccountAuthorize(data) {
  return request({
    url: 'system/account/authorize',
    method: 'post',
    data: data
  })
}

//修改酒店账号授权
export function putAccountAuthorize(data) {
  return request({
    url: 'system/account/authorize',
    method: 'put',
    data: data
  })
}

//删除酒店账号授权
export function delAccountAuthorize(data) {
  return request({
    url: 'system/account/authorize',
    method: 'delete',
    data: data
  })
}

//校验app用户token, 传入token值, 返回account, orgCode, id
export function checkAppUserToken(query) {
  return request({
    url: '/system/account/authorize/checkToken',
    method: 'post',
    params: query
  })
}

// 导出酒店数据
export function exportHotel(query) {
  return request({
    url: 'system/account/authorize/export',
    method: 'get',
    params: query
  })
}

// 获取酒店房间的设备数量
export function getHotelDeviceCount(query) {
  return request({
    url: '/system/account/authorize/hotel/rooms',
    method: 'get',
    params: query
  })
}

// 导出酒店房间的设备数量
export function exportHotelDeviceCount(query) {
  return request({
    url: 'system/account/authorize/hotelRoomCount/export',
    method: 'get',
    params: query
  })
}
